package actions;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import beans.User;
import beans.UserDAO;

public class UserActionModifyTj implements UserAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException {
		
		boolean flag;
		UserDAO userdao=new UserDAO();			
		flag=userdao.updatephoto(request);
		//String userno3=request.getParameter("userno");这句出错，因为前面表单中使用了multipart/form-data，所以用request接不到
		if(flag){
			//session.setAttribute("userno",userno);//接不到，所以无法设置，到insertphoto里去设置setAttribute

			response.sendRedirect("UserServlet?id=5");//修改自身信息后，要回到修改身页面，所以发id号为5
			//或者写new UserActionModify().execute(request, response);
		}else{
			response.sendRedirect("error.jsp");
		}
		
		


	}

}
